home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
176-200
/
disk_191
/
ispell
/
src.zoo
/
hash.c
< prev
next >
Wrap
Text File
|
1989-02-22
|
350b
|
28 lines
/* -*- Mode:Text -*- */
/*
* hash.c - a simple hash function for ispell
*
* Pace Willisson, 1983
*/
hash (s, n, hashsize)
register char *s;
register n;
register hashsize;
{
register short h = 0;
while (n--) {
h ^= *s++;
if (h < 0) {
h <<= 1;
h++;
} else {
h <<= 1;
}
}
h &= 077777;
return (unsigned long) h % hashsize;
}